package com.ruoyi.configManage.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.configManage.domain.Logistics;
import com.ruoyi.configManage.mapper.LogisticsMapper;
import com.ruoyi.configManage.service.ILogisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 物流公司Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-23
 */
@Service
public class LogisticsServiceImpl implements ILogisticsService 
{
    @Autowired
    private LogisticsMapper logisticsMapper;

    /**
     * 查询物流公司
     * 
     * @param id 物流公司主键
     * @return 物流公司
     */
    @Override
    public Logistics selectLogisticsById(Long id)
    {
        return logisticsMapper.selectLogisticsById(id);
    }

    /**
     * 查询物流公司列表
     * 
     * @param logistics 物流公司
     * @return 物流公司
     */
    @Override
    public List<Logistics> selectLogisticsList(Logistics logistics)
    {
        return logisticsMapper.selectLogisticsList(logistics);
    }

    /**
     * 新增物流公司
     * 
     * @param logistics 物流公司
     * @return 结果
     */
    @Override
    public int insertLogistics(Logistics logistics)
    {
        logistics.setCreateTime(DateUtils.getNowDate());
        return logisticsMapper.insertLogistics(logistics);
    }

    /**
     * 修改物流公司
     * 
     * @param logistics 物流公司
     * @return 结果
     */
    @Override
    public int updateLogistics(Logistics logistics)
    {
        return logisticsMapper.updateLogistics(logistics);
    }

    /**
     * 批量删除物流公司
     * 
     * @param ids 需要删除的物流公司主键
     * @return 结果
     */
    @Override
    public int deleteLogisticsByIds(Long[] ids)
    {
        return logisticsMapper.deleteLogisticsByIds(ids);
    }

    /**
     * 删除物流公司信息
     * 
     * @param id 物流公司主键
     * @return 结果
     */
    @Override
    public int deleteLogisticsById(Long id)
    {
        return logisticsMapper.deleteLogisticsById(id);
    }
}
